<extend name="Public/baseConf" />
<block name="breadcrumb"> 
	<div class="row wrapper border-bottom white-bg page-heading">
	    <div class="col-lg-8">
	        <h2>用户组授权<small>[{$nickname} 所属的用户组列表]</small></h2>
	        <ol class="breadcrumb">
	            <li><a href="{:U('index/index')}">首页</a></li>
	            <li><a href="{:U('User/index')}">用户管理</a></li>
	            <li class="active">
	                <strong>用户组授权</strong>
	            </li>
	        </ol>
	    </div>	    
	    <div class="col-lg-4">
            <div class="title-action">
 				<button class="btn btn-primary ajax-post" type="submit" target-form="form-horizontal"><i class="fa fa-check"></i>保存</button>
	            <a class="btn btn-warning" href="{:U('User/index')}"><i class="fa fa-reply"></i>返回</a>
            </div>
        </div>
	</div> 
</block>
<block name="body">
	<div class="row">
	    <div class="col-lg-12">
	        <div class="ibox float-e-margins">
	            <div class="ibox-title">
	                <h5>请选择权限组<small></small></h5>
	                <div class="ibox-tools">
	                    <a class="collapse-link">
	                        <i class="fa fa-chevron-up"></i>
	                    </a>
	                </div>
	            </div>
	            <div class="ibox-content">
	                <form class="form-horizontal" action="{:U('addToGroup')}" method="post" >
			            <div class="form-group">
                            <div class="col-sm-12">
	                            <volist name="auth_groups" id="vo">
									<div class="i-checks">
										<label> <input  name="group_id[]" type="checkbox" value="{$vo.id}" class="ace auth_groups" > <i></i>{$vo.title}</label>
									</div>
					            </volist>
                            </div>
                        </div>
			            <input type="hidden" name="uid" value="{:I('uid')}">
					    <input type="hidden" name="batch" value="true">  
	                </form>
	            </div>
	        </div>
	    </div>
	</div> 
</block>
<block name="script">
<script type="text/javascript">
$(function(){
    var group = [{$user_groups}];
    $('.auth_groups').each(function(){
        if( $.inArray( parseInt(this.value,10),group )>-1 ){
            $(this).prop('checked',true);
        }
    });
});
</script>
</block>